import { createRouter, createWebHashHistory } from "vue-router";

let routes = [
  {
    path:"/",
    redirect:{
      path: "/home",
    }
  },
  {
    path:"/home",
    component:()=>import("@/views/home/HomePage.vue")
  },
  {
    path: "/login",
    component: () => import("@/views/Login.vue"),
  },
  {
    path: "/dashboard",
    component: () => import("@/views/dashboard/Dashboard.vue"),
    redirect: {
      path: "/dashboard/article",
    },
    children: [
      {
        path: "/dashboard/article",
        component: () => import("@/views/dashboard/article/Article.vue"),
      },
      {
        path: "/dashboard/category",
        component: () => import("@/views/dashboard/Category.vue"),
      },
    ],
  },
  {
    path:"/detail",
    component: () => import("@/views/Detail.vue"),
  },
  {
    path: "/test",
    component: () => import("@/views/test.vue"),
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});
export { router, routes };
